﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HidesaburoDotNET.Core.Detecctors
{
    class PinfuDetector:YakuDetector
    {
        public override Yaku CheckYaku(AgariTehai agariTehai)
        {
            if (agariTehai.Mentsu.Count != 5) return new Yaku();
            //すべての牌をチェックする
            for (int i = 1; i <= agariTehai.Mentsu.Count; i++)
            {
                if (agariTehai.Mentsu[i].Type != MentsuType.Syuntsu_A) return new Yaku();
            }
            if (agariTehai.Player.CheckYakuHai(agariTehai.Mentsu[0].Hais[0])) return new Yaku();
            return new Yaku(1, "平和");
        }
    }
}
